﻿#ifndef QTWIDGETSAPPLICATION1_H
#define QTWIDGETSAPPLICATION1_H

#include <QMainWindow>
#include <QPushButton>
#include <QRubberBand>
#include <QPixmap>
#include <QTimer>

class QtWidgetsApplication1 : public QMainWindow
{
    Q_OBJECT

public:
    QtWidgetsApplication1(QWidget* parent = nullptr);
    ~QtWidgetsApplication1();

protected:
    void mousePressEvent(QMouseEvent* event) override;
    void mouseMoveEvent(QMouseEvent* event) override;
    void mouseReleaseEvent(QMouseEvent* event) override;
    void paintEvent(QPaintEvent* event) override;

private slots:
    void onScreenshotButtonClicked();
    void captureScreenAndShowFullScreen(); // 添加槽函数声明

private:
    QPushButton* screenshotButton;
    QRubberBand* rubberBand;
    QPoint origin;
    bool isSelecting;
    bool isFullScreen;
    QPixmap backgroundPixmap; // 添加背景图片成员变量
};

#endif // QTWIDGETSAPPLICATION1_H